<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
cfc('core')->checklogin();
if($_RQ['op']=='main'){
	$return['list']=array();
	$return['credit_types']=array('获得','扣除');
	$return['params']['status']=intval($_RQ['status']);
	set_html('title','在线问诊');
	exi($return);
}
if($_RQ['op']=='list'){	
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
	$params['status']=intval($_RQ['status']);
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$list=$this->pdo_getslice('worker_goods_order',$params,array($pindex,$psize),$total,'','','id desc');
	if($list){
		$status=array('待支付','已支付','已使用');
		foreach($list as &$item){
			$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
			$item['ispaytitle']=$item['ispay']?'已支付':'未支付';
			$item['statustitle']=$status[$item['status']];
			$item['worker']=pdo_get('jy_zhongyi_worker',array('uniacid'=>$_SESSION['uniacid'],'id'=>$item['workerid']),array('lesson_id','storeid','name'));
			$item['goods']=pdo_get('jy_zhongyi_worker_goods',array('uniacid'=>$_SESSION['uniacid'],'id'=>$item['goods_id']),array('title','image','id'));
			$item['hexiaourl']=custom_url('jy_zhongyi/worker.hexiao//id='.$item['id'],true);
		}
	}
	$return['list']=$list;
	exi($return);
}